#pragma once

#include <string>
#include <iostream>
#include "MyTask.h"

using std::string;
using std::cout;
using std::endl;

class ErrorTask
: public MyTask
{
public:
    ErrorTask(const string &msg, const TcpConnectionPtr &con)
    : m_msg(msg), m_con(con)
    {}

    virtual void process(MyThread *) override
    {
        m_msg = "错误的请求：" + m_msg;
        m_con->sendInLoop(m_msg);
    }

    virtual ~ErrorTask() override
    {}
private:
    string m_msg;
    TcpConnectionPtr m_con;

};